/* 
 * LessThanComparator.java
 *
 * Create on Mar 29, 2014 10:53:49 PM
 *
 * Copyright (c) 2014 Zhiyong's Design Studio.
 *
 * This software contains confidential proprietary information belonging
 * to Zhiyong's Design Studio. No part of this information may be used, reproduced, 
 * or stored without prior written consent of Zhiyong's Design Studio.
 *
 */

package com.zhiyongstudio.contactorbook.datamodel;

import java.util.Comparator;

/**
 * @version Revision 1.0.0.0
 * @since Build 1.0.0.0: Mar 29, 2014
 * @author Zhiyong's Design Studio
 */
public class LessThanComparator implements Comparator{
    @Override
    public int compare(Object o1, Object o2) {
        int x;
        int y;
        x = Integer.parseInt(((ProjectDataNode)o1).getCallNr());
        y = Integer.parseInt(((ProjectDataNode)o2).getCallNr());
        
        if(x<y){
            return -1;
        }else if(x == y){
            return 0;
        }else{
            return 1;
        }        
    }

}
